package App.Repository;

import App.Entity.Project;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by yu on 2017/7/19.
 */
@Repository
public interface ProjectRepository extends CrudRepository<Project,Long>
{
    @Query(value = "from Project project where project.id in :ids and project.status=:status ")
    public List<Project> findAllByIdsAndStatusOrderByPublicTimeDesc(@Param("ids") List<Long>ids,@Param("status") int status);

    @Query("select title from Project project where project.id=:id")
    public String getProjectName(@Param("id") Long ProjectId);


}
